<?php

class contact extends stwidgets {

    function contact() {
        $this->WP_Widget(false, $name = 'Hệ thống cửa hàng');
    }

    function widget($args, $instance) {
        $contact_title = $instance['contact_title'];
        $contact_address = $instance['contact_address'];
        $contact_website = $instance['contact_website'];
        $contact_fb = $instance['contact_fb'];
        $contact_email = $instance['contact_email'];
        $contact_logo = $instance['contact_logo'];
        $contact_color = $instance['contact_color'];
        ?>
        <div class="long-box contact">
            <img src="<?php echo $contact_logo ?>" align="left">
            <div class="info-box" style="background:<?php echo $contact_color ?>;">
                <br>
                <p><?php echo $contact_title ?></p>
                <br>
                <p>A: <?php echo $contact_address ?></p>
                <p>W: <a href="<?php echo $contact_website ?>"><?php echo $contact_website ?></a></p>
                <p>F: <a href="<?php echo $contact_fb ?>"><?php echo $contact_fb ?></a></p>
                <p>F: <a href="mailto:<?php echo $contact_email ?>"><?php echo $contact_email ?></a></p>
                <br>
                <p><a href="https://maps.google.com/maps?q=<?php echo urlencode($contact_address) ?>,+Vietnam&hl=en&output=embed&iframe=true&width=640&height=320" rel="prettyPhoto" class="map-btn">Xem bản đồ</a></p>
                <br>
            </div>
            <div style="clear:both;"></div>
        </div>

    <?php }

    function form($instance) {
        ?>
        <p>
            <label for="">Tên cửa hàng</label>
            <input type="text" name="contact_title" class="widefat" value="<?php echo $instance['contact_title'] ?>">
        </p>
         <p>
            <label for="">Địa chỉ</label>
            <input type="text" name="contact_address" class="widefat" value="<?php echo $instance['contact_address'] ?>">
        </p>
        <p>
            <label for="">Website</label>
            <input type="text" name="contact_website" class="widefat" value="<?php echo $instance['contact_website'] ?>">
        </p>
        <p>
            <label for="">Facebook</label>
            <input type="text" name="contact_fb" class="widefat" value="<?php echo $instance['contact_fb'] ?>">
        </p>
        <p
            <label for="">Email</label>
            <input type="text" name="contact_email" class="widefat" value="<?php echo $instance['contact_email'] ?>">
        </p>
        <p
            <label for="">Logo</label>
            <input type="text" name="contact_logo" class="widefat" value="<?php echo $instance['contact_logo'] ?>">
        </p>
         <p
            <label for="">Color</label>
            <input type="text" name="contact_color" class="widefat" value="<?php echo $instance['contact_color'] ?>">
        </p>
        <?php
    }

}